package jianzhiOffer;
//剑指 Offer 24. 反转链表
public class Num24_reverseList {
    public ListNode reverseList(ListNode head) {
        if (head==null||head.next==null){
            return head;
        }
        ListNode sc = head.next;
        ListNode newHead = null;
        newHead =reverseList(head.next);
        sc.next = head;
        head.next = null;
        return newHead;
    }
}
